In [1]:
import mtwaffle
!git describe
Load a response function from an Electrical Data Interchange (EDI) file:
In [2]:
site = mtwaffle.read_edi('bwa2890.edi')
When data is read in like this it will be loaded into an mtwaffle.mt.Site object. This is a dict-like object with attribute access.
The fundamental data that make up the response function are stored as numpy.ndarrays and can be changed by the user:
In [3]:
site.name
Out[3]:
In [4]:
site.freqs
Out[4]:
And the impedance tensors:
In [5]:
site.zs
Out[5]:
Other properties are lazy i.e. they are calculated when they are accessed:
In [6]:
site.res_xy
Out[6]:
Attributes are also available through item-style access, as mtwaffle.mt.Site is inherited from attrdict.AttrDict (more info):
In [7]:
site['phase_yx']
Out[7]:
A complete list of the attributes available for an mtwaffle.Site object can be produced using the site.help() method:
In [8]:
site.help()
In case it is not clear, here is an example. For this site we can apply the Bostick transform to obtain a list of the depths from the transform, and the resistivities:
In [9]:
depths, res = site.bostick
And now check the xy values:
In [10]:
depths[:, 0, 1]
Out[10]:
In [11]:
res[:, 0, 1]
Out[11]:
This is actually calculated behind the scenes using a stand-alone function from mtwaffle.mt, as described in the list just above. We can do the same manually to illustrate the process:
In [12]:
depths_xy, res_xy = mtwaffle.bostick(site.freqs, site.res_xy, site.phase_xy)
In [13]:
depths_xy
Out[13]:
There are many more functions in mtwaffle.mt, but they are often only intermediary properties which are not often of interest. You can use them all manually, check the documention for more information by running help(mtwaffle.mt).
In [14]:
%matplotlib nbagg
Graphing functions are also wrapped from mtwaffle.graphs:
In [15]:
site.plot_impedance_tensors()
In [16]:
axreal, aximag = site.plot_mohr_imp()
In [17]:
site.plot_ptensell()
In [18]:
site.plot_ptensell_filled(site.ptens_max)
In [19]:
site.plot_mohr_ptensor()
In [20]:
In [20]: